import fileUtil from '../src/utils/file'
import path from 'path'
import Mock from 'mockjs'

const data = fileUtil.getJson5(path.join(__dirname, 'data' + path.sep + 'video.json5'))

// console.log(data)

export default [
  {
    url: '/video/list',
    type: 'get',
    response: config => {
      return {
        code: 20000,
        data: {
          items: Mock.mock(data),
          total: 3
        }
      }
    }
  },

  {
    url: '/video/detail',
    type: 'get',
    response: config => {
      let thisData = data.filter(item => item.id == config.query.id);
      return {
        code: 20000,
        data: thisData[0]
      }
    }
  }
]
